//
// Created by Administrator on 2024/3/17.
//
// O(nlog(n))排序+二分查找

#include<bits/stdc++.h>

using namespace std;
using ll=long long;
const int maxn = 1e5 + 1000;
ll a[maxn], n, k;

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    cin >> k;
    sort(a, a + n);
    for (int i = 0; i < n; i++) {
        if (binary_search(a + i + 1, a + n, k - a[i])) {
            cout << a[i] << " " << k - a[i] << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}